package com.power.using.mydaggerp.model.detail;

import android.support.annotation.NonNull;

import com.power.using.mydaggerp.api.ZhihuApi;
import com.power.using.mydaggerp.base.BaseModel;
import com.power.using.mydaggerp.contract.detail.ZhihuDetailContract;
import com.power.using.mydaggerp.model.bean.zhihu.ZhihuDailyDetailBean;
import com.zyw.horrarndoo.sdk.helper.RetrofitCreateHelper;
import com.zyw.horrarndoo.sdk.helper.RxHelper;

import io.reactivex.Observable;

/**
 * Created by 聪明一只哈 on 2019/10/12.
 * Time: 2019/10/12  10:58
 */
public class ZhihuDetailModel extends BaseModel implements ZhihuDetailContract.IZhihuDetailModel{

    @NonNull
    public static ZhihuDetailModel newInstance() {
        return new ZhihuDetailModel();
    }


    @Override
    public Observable<ZhihuDailyDetailBean> getDailyDetail(String id) {
        return RetrofitCreateHelper.createApi(ZhihuApi.class,ZhihuApi.HOST).getZhihuDailyDetail(id)
                .compose(RxHelper.<ZhihuDailyDetailBean>rxSchedulerHelper());
    }
}
